import Vue from "vue";
import VueRouter from "vue-router";


Vue.use(VueRouter);

const routes = [
  {
    path: "/home",
    name: "home",
    component: ()=> import("../views/Home.vue"), 
  },
  {
    path:"/",
    redirect:'/home',  // 重定向
  },
  {
    path: "/list",
    name: "list",
    component: () => import("../views/List.vue")
  },
  {
    path: "/message",
    name: "message",
    component: () => import("../views/Message.vue")
  },
  {
    path: "/cart",
    name: "cart",
    component: () => import("../views/Cart.vue")
  },
  {
    path: "/mine",
    name: "mine",
    component: () => import("../views/Mine.vue")
  },
  {
    path: "/detail",
    name: "detail",
    component: () => import("../views/Detail.vue"),
    meta:{  // 元信息
      ishide:true
    }
  },
  {
    path: "/reg",
    name: "reg",
    component: () => import("../views/Reg.vue"),
    meta:{  // 元信息
      ishide:true
    }
  },
  {
    path: "/login",
    name: "login",
    component: () => import("../views/Login.vue"),
    meta:{  // 元信息
      ishide:true
    }
  }
];

const router = new VueRouter({
  routes
});

export default router;
